{/* LAYOUT模板 */}
<layout name="login_layout"/>
{/* LAYOUT模板 */}
{/* import Js,Css */}	
<css href="__CSS__/jquery-ui.css" />
<css href="__THEMES__/css/common.css" />
<css href="__THEMES__/css/style.css" />
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.2/css/bootstrap.min.css">
<script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<js href="__JS__/core/jquery-ui.1.10.4.js"/>
<js href="__JS__/core/plugins.js"/>
<js href="__JS__/core/jquery.form.js"/>
{/* import Js,Css */}

<div id="loading"><!--加载条--></div>

<div class="space100"></div>

<div class="w_1200 mauto">
	<div class="" style="width:960px;margin:auto;">
		<h3 style="height:40px;line-height:40px;text-indent:20px; border-bottom:1px solid #E0E0E0;color:#303030; margin-top:80px;" class="">找回密码</h3>
		<div>
			<div style="margin:auto;margin-top:30px;width: 80%;">
				<form id="get-pwd-form" class="form-horizontal">
				  <div class="form-group">
				    <label class="col-sm-2 control-label" style="font-size:16px;font-weight:500;">手机号</label>
				    <div class="col-sm-10">
				      <input type="text" id="mobile" class="form-control" name="mobile" style="margin-left:20px;width:300px;height:50px;" id="inputPassword" placeholder="填写手机号">
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="inputPassword" class="col-sm-2 control-label" style="font-size:16px;font-weight:500;">重置密码</label>
				    <div class="col-sm-10">
				      <input type="password" id="password" class="form-control" name="password" style="margin-left:20px;width:300px;height:50px;" id="inputPassword" placeholder="8-20字符,区分大小写">
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="inputPassword" class="col-sm-2 control-label" style="font-size:16px;font-weight:500;">验证码</label>
				    <div class="col-sm-10">
				    	<div style="width:50%;margin-left:0px;">
				    		<div class="row">
							  <div class="col-md-6">
							  		<input type="text" id="code" name="code" class="form-control" style="margin-left:20px;width:150px;height:50px;" id="inputPassword" placeholder="">
							  </div>
							  <div class="col-md-6">
							  		<button type="button" id="check_code" class="btn btn-default" style="height:50px;">免费获取验证码</button>
							  </div>
							</div>
				    	</div>				      
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="inputPassword" class="col-sm-2 control-label" style="font-size:16px;font-weight:500;">&nbsp;&nbsp;</label>
				    <div class="col-sm-10">
				     	<button type="button" id="qs-submit-btn" class="btn btn-success" style="height:50px;margin-left:20px;width:300px;">提交</button>
				    </div>
				  </div>
				   <div class="form-group">
				    <label for="inputPassword" class="col-sm-2 control-label" style="font-size:16px;font-weight:500;">&nbsp;&nbsp;</label>
				    <div class="col-sm-10">
				     	<!--忘记密码提示-->
						<dl class="clearfix">
							<dd>
								<div class="actionSub mp50" >
									<a href="__URL__/login">{$lang.want_login}</a><br />
									<a href="__URL__/get_password">{$lang.forgot_password}</a>
								</div>
							</dd>
						</dl>
						<!--忘记密码提示-->
				    </div>
				  </div>
				</form>
			</div>
		</div>
	</div>
</div>

<div class="space20"></div>

<script type="text/javascript">
$(document).ready(function(){
	//重置密码
	$('#check_code').click(function(){
		var mobile 	=	document.getElementById("mobile").value;
		if(mobile == '' || mobile == null || typeof mobile == 'undefined') { 
			alert("手机号码不能为空"); return;
		}
		else if(mobile.length != 11){
			alert("手机号码长度不对"); return;
		}
		$.ajax({
			type:"post",
			url:"{:U('pass/send_verify_code')}",
			dataType:'json',
			data:{mobile:mobile},
			beforeSend:function(){
				$('#loading').QLoading({text:'',status:'open',modal:true});
			},
			success:function(msg){
				if(msg.info == 'ok'){
					$('#loading').QLoading({text:'验证码发送成功',img:'happy',status:'close',modal:false,time:1.5});
				}
				else{
					$('#loading').QLoading({text:'验证码发送失败',img:'happy',status:'close',modal:false,time:1.5});
				}
			},
			error:function(xhr,status,text){}
		});
	});	
	/*提交*/
	$('#qs-submit-btn').click(function(){
		var datas	=	$('#get-pwd-form').QVal();//获取表单值
		$("#get-pwd-form").ajaxSubmit({
	     	type: "post",
	     	url: "{:U('pass/set_password')}",
	     	beforeSend:function(){
	     		$('#loading').QLoading({text:'',status:'open',modal:true});
	     	},
	     	success: function(msg){
	           if(msg.info == 'ok'){
					$('#loading').QLoading({text:msg.data,img:'happy',status:'close',modal:false,time:1.5});
				}
				else{
					$('#loading').QLoading({text:msg.data,img:'happy',status:'close',modal:false,time:1.5});
				}
	     	}
		});
	});
});
</script>


<include file="Library:index_footer"/>


